<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: 'index' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <template>
      <el-table :data="rightList" style="width: 100%" border stripe>
        <el-table-column type="index"> </el-table-column>
        <el-table-column prop="authName" label="权限名称" width="180">
        </el-table-column>
        <el-table-column prop="path" label="路径" width="180">
        </el-table-column>
        <el-table-column label="权限等级" prop="level">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.level == 0" type="success">一级权限</el-tag>
            <el-tag v-else-if="scope.row.level == 1" type="warning"
              >二级权限</el-tag
            >
            <el-tag v-else-if="scope.row.level == 2" type="info"
              >三级权限</el-tag
            >
          </template>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      rightList: [],
    };
  },
  methods: {
    levelValue(e) {

    },
  },
  mounted() {
    // 获取权限列表
    this.$Req.get(`rights/list`).then((res) => {
      const { data, meta } = res.data;

      this.rightList = data;
    });
    this.levelValue();
  },
};
</script>

<style>
</style>